package small.hero.sexual.life.tips.zl;


import com.google.ads.AdRequest;
import com.google.ads.AdSize;
import com.google.ads.AdView;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;

public class SexLife extends Activity {
	private ListView mListView;
	private final String[] category = { "Colour and Sex", "Star Sign and Sex ",
			"What Men Want ", " What men should do after sex",
			"How to get in mood in 5 minutes ", "What's Your Sex Style",
			" Get The Best Out of Your Sex Positions", "Change your sex style",
			"Take Him By Surprise",
			"Spice up your love life with Aphrodisiacs",
			" Essentials of Foreplay", "The Oral Ecstasy",
			"Pleasing Yourself ", "Oral Ecstasy -The G-spot",
			" Touch and Feel", "Learn to touch your woman",
			"Sensuous Sex Games", "Places to make love", "Get in the Groove",
			"Tips to turn him on tonight ", "How To Seduce Your Man",
			"How to make your man happy ", "Sexual Positions Women Enjoy",
			"Sensuous Bath", "Mysteries of Fragrance" };

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.list);
		bundleView();
		initData();
		
		//广告
		final LinearLayout layout = (LinearLayout) findViewById(R.id.linearLayout);
		final AdView adView = new AdView(this, AdSize.BANNER, "a14e3bcb363a67c");
		layout.addView(adView);
		adView.loadAd(new AdRequest());
	}

	private void bundleView() {
		mListView = (ListView) findViewById(R.id.myList);
	}

	private void initData() {
		ArrayAdapter<String> mAdapter = new ArrayAdapter<String>(SexLife.this,
				android.R.layout.simple_expandable_list_item_1, category);
		mListView.setAdapter(mAdapter);
		mListView.setOnItemClickListener(mClickListener);
	}

	private final OnItemClickListener mClickListener = new OnItemClickListener() {

		@Override
		public void onItemClick(AdapterView<?> parent, View view, int position,
				long id) {
			Intent mIntent = new Intent(SexLife.this, ShowContent.class);
			mIntent.putExtra("Model", position);
			startActivity(mIntent);
		}
	};

}